﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Comment.aspx.cs" Inherits="Course_Comment" %>

<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>课程评价</title>
    <link href="../../css/assets/css/bootstrap.min.css" rel="stylesheet" />
    <link href="../../css/admin.css" rel="stylesheet" />
    <script src="../../js/jquery-1.7.2.min.js"></script>
    <script src="../../css/assets/js/bootstrap.min.js"></script>
    <script src="../../Js/laydate/laydate.js"></script>
    <script src="../../Js/layer/layer.js"></script>
</head>
<body>
    <form id="form1" runat="server">
        <div>
            <div class="row">
                <div runat="server" id="divCondition">
                    <div class="col-lg-4 col-md-4 col-sm-6 colSpace">
                        起始时间：
                    <br />
                        <asp:TextBox runat="server" ID="txtStart" CssClass="txtSize" onfocus="laydate()"></asp:TextBox>
                    </div>
                    <div class="col-lg-4 col-md-4 col-sm-6 colSpace">
                        截止时间：
                    <br />
                        <asp:TextBox runat="server" ID="txtEnd" CssClass="txtSize" onfocus="laydate()"></asp:TextBox>
                    </div>
                    <div class="col-lg-4 col-md-4 col-sm-6 colSpace" style="margin-top: -2px">
                        <br />
                        <asp:Button runat="server" ID="btnSelect" Text="查询" CssClass="btn btn-primary btnSize" OnClick="btnSelect_Click" />&nbsp;&nbsp;&nbsp;&nbsp;
             <asp:Label runat="server" CssClass="txtWarn" ID="lblWarn"></asp:Label>
                    </div>
                </div>
            </div>
            <br />
              <asp:HiddenField ID="txtCourseID" runat="server" />
           
         <asp:Label runat="server" ID="txtCourseName" style="font-family:微软雅黑;color:#2564bb;font-size: 16px;"></asp:Label>
             <br /> <br />
            <div>
                <asp:GridView runat="server" ID="gridList" CssClass="table table-striped table-bordered table-hover" AutoGenerateColumns="False" DataKeyNames="CommentID,CourseID" OnRowDeleting="gridList_RowDeleting">
                    <Columns>

                        <asp:BoundField DataField="NickName" HeaderText="评价人" />
                        <asp:BoundField DataField="MobilePhone" HeaderText="手机号" />
                        <asp:BoundField DataField="PraiseNum" HeaderText="点赞数" />
                        <asp:BoundField DataField="CommentContent" HeaderText="评价内容" HeaderStyle-Width="20%" />
                        <asp:BoundField DataField="CreateTime" HeaderText="评价时间" />
                        <asp:BoundField DataField="ReplyContent" HeaderText="回复内容"  HeaderStyle-Width="20%"/>
                         <asp:BoundField DataField="ReplyTime" HeaderText="回复时间"  />


                        <asp:TemplateField HeaderText="状态"><%--待审核/已通过/未通过--%>
                            <ItemTemplate>
                                <%# DGFormatSex(Convert.ToString(DataBinder.Eval(Container.DataItem,"Status"))) %>
                            </ItemTemplate>
                        </asp:TemplateField>

                       
                        <asp:TemplateField HeaderText="操作">
                            <ItemTemplate>
                  <asp:LinkButton runat="server" ID="LinkButton1" CommandName="Delete" OnClientClick="return confirm('确定更新状态吗？')" CausesValidation="False"><%#Eval("Status").ToString() == "-1" ? "启用" : "禁用"%></asp:LinkButton>   
                          <%--    <asp:HyperLink ID="HyperLink2" runat="server" NavigateUrl='<%#"Audit.aspx?CommentID="+Eval("CommentID")%>'>审核</asp:HyperLink> --%>
                            </ItemTemplate>
                        </asp:TemplateField>

                        <asp:TemplateField HeaderText="查看&回复">
                            <ItemTemplate>
                 <a style="cursor: pointer" onclick="ShowModal('<%#"Reply.aspx?CommentID="+Eval("CommentID") %>')">查看&回复</a>
                            </ItemTemplate>
                        </asp:TemplateField>

                    </Columns>

                </asp:GridView>
            </div>
            <div class="pagerLayout">
                <webdiyer:AspNetPager ID="netPager" CssClass="pagerLayout" runat="server" FirstPageText="首页" LastPageText="尾页"
                    NextPageText="下一页" OnPageChanged="netPager_PageChanged" PrevPageText="上一页"
                    PageSize="15">
                </webdiyer:AspNetPager>
            </div>
        </div>
    </form>
</body>
</html>

<script>
    //弹出框
    function ShowModal(pageLink) {
        layer.open({
            type: 2,
            title: '用户评价',
            content: pageLink,
            area: ['800px', '600px'],
            offset: '5%',
            closeBtn: 2,
            shade: [0.3, 'black'], //默认是0.3透明度的黑色背景（'#000'）如果不想显示遮罩，可以shade: 0
            shadeClose: true,
            shift: 2, //动画，默认0，  0-6

            //end:layer 关闭刷新父页面
            end: function () {     //end - 层销毁后触发的回调。无论是确认还是取消，只要层被销毁了，end都会执行，不携带任何参数
                location.reload();   
            }
        });
    }
</script>
